package cn.micai.base.thread;

/**
 * 描述：
 * <p>
 *
 * @author: 赵新国
 * @date: 2018/5/11 14:15
 */
public class MyThread2 implements Runnable {

    @Override
    public void run() {
        for (int i=0;i<20;i++) {
            System.out.println(Thread.currentThread().getName()+":"+i);
        }
    }

    public static void main(String [] args) {
        for (int i=0; i<5; i++) {
            // 创建线程目标对象
            Runnable runnable = new MyThread2();
            new Thread(runnable, "thread" + i).start();
        }
    }
}
